package 工具函数模板;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class 费里的语言 {
    public static void main(String[] args) {

        HashMap<String, Integer> hashMap = new HashMap<>();
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        int n = Integer.parseInt(String.valueOf(s));
        for (int i = 0; i < n; i++) {
            String line = scanner.nextLine();
            Integer integer = hashMap.get(line);
            if (integer == null) {
                hashMap.put(line, 1);
            } else {
                hashMap.put(line, integer + 1);
            }
        }

        System.out.println(hashMap);
        boolean isFlag = false;
        for (Map.Entry<String, Integer> entry : hashMap.entrySet()) {
            if (entry.getValue() >= 2) {
                System.out.println(entry.getKey());
                isFlag = true;
            }
        }
        if (!isFlag) {
            System.out.println("NO");
        }

    }
}
